

 
 
*********
***Table 4.3 Zero-inflated Negative Binomial Regression results
    
 zinb totairings lnadj2010candex  lnadj2010oppex  incumb OPENSEAT oppexp new vulnerable ///
   partisangeneral quasipartisan foldcitideol murder ///
   i.broad allspeech2 politregs2 partyregs2 SOLICIT anydq yespolit  ///
   advopins_ma2 discactions_ma2 jccc_strong ///
   yr2002 yr2004 yr2006 yr2008 if contested==1, inflate(lnadj2010candex  incumb OPENSEAT oppexp new vulnerable partisangeneral quasipartisan foldciti6010 murder ///
   i.broad  allregsall)  vce(cluster statecode)
      outreg using "zinb table.doc", se starlevels(10 5 1) ///
	  summstat(N\N_zero\N_clust\chi2\p\ll) summtitles (N\Zero Obs.\# Clusters\Wald chi2\Prob > chi2\Log pseudolikelihood) ///
  varlabels ctitles("", "Variable", "Model 1") replace
estimates store zinb1


 zinb totairings lnadj2010candex  lnadj2010oppex  incumb OPENSEAT oppexp new vulnerable ///
   partisangeneral quasipartisan foldcitideol murder ///
   i.broad allspeech2 politregs2 partyregs2 SOLICIT anydq yespolit  ///
   broad_polit broad_party ///
   advopins_ma2 discactions_ma2 jccc_strong ///
   yr2002 yr2004 yr2006 yr2008 if contested==1, inflate(lnadj2010candex  incumb OPENSEAT oppexp new vulnerable partisangeneral quasipartisan foldciti6010 murder ///
   i.broad  allregsall)  vce(cluster statecode)
      outreg using "zinb table.doc", se starlevels(10 5 1) ///
	  summstat(N\N_zero\N_clust\chi2\p\ll) summtitles (N\Zero Obs.\# Clusters\Wald chi2\Prob > chi2\Log pseudolikelihood) ///
  varlabels ctitles("", "Variable", "Model 2") merge
estimates store zinbbroad2

 zinb totairings lnadj2010candex lnadj2010oppex incumb OPENSEAT oppexp new vulnerable ///
   partisangeneral quasipartisan foldcitideol murder ///
   i.broad allspeech2 politregs2 partyregs2 SOLICIT anydq yespolit  ///
   advopins_ma2 discactions_ma2 jccc_strong ///
   yr2002 yr2004 yr2006 yr2008 if contested==1, inflate(lnadj2010candex incumb OPENSEAT oppexp new vulnerable partisangeneral quasipartisan foldciti6010 murder ///
   i.broad  allspeech2 politregs2 partyregs2 SOLICIT anydq yespolit)  vce(cluster statecode)
        outreg using "zinb table.doc", se starlevels(10 5 1) ///
		summstat(N\N_zero\N_clust\chi2\p\ll) summtitles (N\Zero Obs.\# Clusters\Wald chi2\Prob > chi2\Log pseudolikelihood) ///
	     title("Negative Binomial Results"\"Number of Candidate's Television Ads"\"Contested elections 2002-2010"\"Robust s.e. clustered on state") /// 
  varlabels ctitles("", "Variable", "Model 3") merge
estimates store zinb3






***Figure 4.1 Illustrating effect of canons on likelihood of advertising

*LOGIT to illustrate first stage effects
 
   logit    ranads  lnadj2010candex   incumb OPENSEAT oppexp new vulnerable ///
   partisangeneral quasipartisan foldcitideol murder ///
   broad allspeech2 politregs2 partyregs2 SOLICIT anydq yespolit2  ///
   if contested==1, vce(cluster statecode)
  outreg using "candadvertcontestedbroad.doc", se starlevels(10 5 1) varlabels ///
   ctitles("", "Variable", "Model 1")  replace
   estimates store logit2
   
   
estimates restore logit2
margins, at(politregs2=(0 1 2 3 4))
marginsplot
graph save "politregslogit.gph", replace

   estimates restore logit2
margins, at(SOLICIT=(0 1))
marginsplot
graph save "solicitlogit.gph", replace

graph combine "politregslogit.gph"  ///
"solicitlogit.gph", ///
col(2) iscale(1) ysize(4) xsize(8) saving("fig 4.1.gph")
graph export "P:\Documents\research\Book\Revised draft\fig 4.1.tif", as(tif) width(1800) replace
   
   
***Figure 4.2 Illustrating effects of polit & party regs on # of Candidate Ads  
   
estimates restore zinb1
margins, at(politregs2=(0 1 2 3 4)) atmeans
marginsplot
graph save "zinbpolitregs.gph", replace
margins, at(partyregs2=(0 1 2 3 4 5)) atmeans
marginsplot
graph save "zinbpartyregs.gph", replace



*Run zinb model with polit & party regs treated as continuous so can estimate interactions--same model as Model 1 above
zinb totairings lnadj2010candex lnadj2010oppex incumb OPENSEAT oppexp new vulnerable ///
   partisangeneral quasipartisan foldcitideol murder ///
   i.broad allspeech2 politregs2 partyregs2 SOLICIT anydq yespolit  ///
   broad#c.politregs2 broad#c.partyregs2 ///
   advopins_ma2 discactions_ma2 jccc_strong ///
   yr2002 yr2004 yr2006 yr2008 if contested==1, inflate(lnadj2010candex incumb OPENSEAT oppexp new vulnerable partisangeneral quasipartisan foldciti6010 murder ///
   i.broad  allregsall)  vce(cluster statecode)
estimates store zinbbroad3

estimates store zinbbroad3
margins i.broad, at(politregs2=(0(1)4)) atmeans
marginsplot 
graph save "zinbbroadpolit.gph", replace

estimates store zinbbroad3
margins i.broad, at(partyregs2=(0(1)5)) atmeans
marginsplot
graph save "zinbbroadparty.gph", replace


graph combine "zinbpolitregs.gph"  ///
"zinbpartyregs.gph" ///
"zinbbroadpolit.gph" ///
"zinbbroadparty.gph", ///
row(2) col(2) altshrink ysize(8) xsize(8) saving("fig 4.2.gph", replace)
graph export "fig 4.2.tif", as(tif) width(1800) replace





***Fig 4.3 Illustrating Effect of canons under different partisanship conditions

estimates restore logit2

margins, at(politregs2=(0 4) partisangeneral=(0 1) quasipartisan=(0) (median) lnadj2010candex foldcitideol murder (asobserved) _all) 
marginsplot , xdimension( partisangeneral politregs2) horizontal recast(scatter)
graph save "fig 4.3 logita.gph"


estimates restore zinb1
margins, at(politregs2=(0 4) partisangeneral=(0 1) quasipartisan=(0) (median) lnadj2010candex  lnadj2010oppex  foldcitideol murder (asobserved) _all) 
marginsplot , xdimension( partisangeneral politregs2) horizontal recast(scatter)
 graph save "politorg part-nonpart.gph"

 estimates restore zinb1
margins, at(partyregs2=(0 5) partisangeneral=(0 1) quasipartisan=(0) (median) lnadj2010candex  lnadj2010oppex  foldcitideol murder (asobserved) _all) 
marginsplot , xdimension( partisangeneral partyregs2) horizontal recast(scatter)
graph save  "partyregs part-nonpart.gph"


graph combine "fig 4.3 logita.gph"  ///
"politorg part-nonpart" ///
"partyregs part-nonpart", ///
row(2) col(2) altshrink ysize(8) xsize(8) saving("fig 4.3 scenarios.gph", replace)
graph export "fig 4.3.tif", as(tif) width(1800) replace





***Fig 4.4 Illustrating Effect of canons under different spending conditions
estimates restore zinb1
margins, at(politregs2=(0 4) lnadj2010candex =(8.033552 9.071336 9.911873) (median) lnadj2010oppex  foldcitideol murder (asobserved) _all)
marginsplot , xdimension(lnadj2010candex  politregs2  ) horizontal recast(scatter)
graph save "\\thor.ad.uni.edu\users\petersc\Documents\research\Book\Data & analysis\chapter 4\revision\fig 4.3 spending and regs.gph"

estimates restore zinb1
margins, at(partyregs2=(0 5) lnadj2010candex =(8.033552 9.071336 9.911873) (median) lnadj2010oppex  foldcitideol murder (asobserved) _all)
marginsplot , xdimension(lnadj2010candex  partyregs2  ) horizontal recast(scatter)
graph save "\\thor.ad.uni.edu\users\petersc\Documents\research\Book\Data & analysis\chapter 4\revision\fig 4.3 spending and party regs.gph"


graph combine "p:\Documents\research\Book\Data & analysis\chapter 4\revision\fig 4.3 spending and regs.gph"  ///
"p:\Documents\research\Book\Data & analysis\chapter 4\revision\fig 4.3 spending and party regs.gph", ///
row(1) col(2) altshrink ysize(4) xsize(8) saving("p:\Documents\research\Book\Data & analysis\chapter 4\revision\fig 4.4 scenarios.gph", replace)
graph export "P:\Documents\research\Book\Revised draft\fig 4.4.tif", as(tif) width(1800) replace




***OLS Only Trad Air Model




reg pctonlytradair totaloppairings incumb OPENSEAT oppexp new vulnerable ///
     partisangeneral quasipartisan foldcitideol murder ///
   i.broad  allspeech2 politregs2 partyregs2 yespolit SOLICIT anydq ///
   advopins_ma2 discactions_ma2 jccc_strong ///
   yr2002 yr2004 yr2006 yr2008 if ranads==1, vce(cluster statecode)
   outreg using "\\thor.ad.uni.edu\users\petersc\Documents\research\Book\Data & analysis\chapter 4\revision\onlytradfinal 1-28.doc", se starlevels(10 5 1) varlabels ctitles("Variable", "Model 1") replace 
 estimates store onlytrad1
 
 reg pctonlytradair totaloppairings incumb OPENSEAT ///
    i.broad  allspeech2 politregs2 partyregs2 yespolit SOLICIT anydq ///
   yr2002 yr2004 yr2006 yr2008 if ranads==1, vce(cluster statecode)
   outreg using "\\thor.ad.uni.edu\users\petersc\Documents\research\Book\Data & analysis\chapter 4\revision\onlytradfinal 1-28.doc", se starlevels(10 5 1) varlabels ctitles("Variable", "Model 2") merge 
 estimates store onlytrad2
  

reg pctonlytradair totaloppairings incumb OPENSEAT oppexp new vulnerable ///
     partisangeneral quasipartisan foldcitideol murder ///
   i.broad  allregsall yespolit  ///
   advopins_ma2 discactions_ma2 jccc_strong ///
   yr2002 yr2004 yr2006 yr2008 if ranads==1, vce(cluster statecode)
  estimates store onlytrad3
  outreg using "\\thor.ad.uni.edu\users\petersc\Documents\research\Book\Data & analysis\chapter 4\revision\onlytradfinal 1-28.doc", se starlevels(10 5 1) varlabels ctitles("Variable", "Model 3") merge

